package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpc "gitee.com/cloudapex/protos/comm/pb"
	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

var Work work

type work struct {
	cli gpb.WorkPoolSerClient
}

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		Work.cli = gpb.NewWorkPoolSerClient(c)
	})
}

//获取首咨库存工作池列表
func (this *work) GetWorkPoolList(ctx context.Context, in *gpb.WorkPoolReq) (*gpb.WorkPoolRes, error) {
	return this.cli.GetWorkPoolList(ctx, in)
}
func (this *work) GetWorkPoolTgList(ctx context.Context, in *gpb.WorkPoolTgReq) (*gpb.WorkPoolTgRes, error) {
	return this.cli.GetWorkPoolTgList(ctx, in)
}
func (this *work) WorkPoolAdd(ctx context.Context, in *gpb.WorkPool) (*gpb.BaseWorkRes, error) {
	return this.cli.WorkPoolAdd(ctx, in)
}

func (this *work) DelWorkPool(ctx context.Context, in *gpc.BaseReq) (*gpc.BaseRes, error) {
	return this.cli.DelWorkPool(ctx, in)
}

func (this *work) EditWorkPool(ctx context.Context, in *gpb.WorkPool) (*gpc.BaseRes, error) {
	return this.cli.EditWorkPool(ctx, in)
}

func (this *work) SetWorkLogic(ctx context.Context, in *gpb.WorkLogicReq) (*gpc.BaseRes, error) {
	return this.cli.SetWorkLogic(ctx, in)
}

func (this *work) WorkPoolAddAll(ctx context.Context, in *gpb.WorkPoolLi) (*gpc.BaseRes, error) {
	return this.cli.WorkPoolAddAll(ctx, in)
}

func (this *work) SelectWorkPool(ctx context.Context, in *gpb.WorkPool) (*gpb.BaseWorkRes, error) {
	return this.cli.SelectWorkPool(ctx, in)
}
